package com.huang.enums;

import lombok.Getter;
// 返回包装类枚举
@Getter
public enum ResultStatus {

    SUCCESS(0, "成功", null),

    SYS_UNKNOWN_ERROR(-1, "未知错误", null),
    LOGIN_ERROR(10086, "账号或密码错误", null),

    SYS_NOT_FOUND(100000, "访问路径有误", null),
    SYS_METHOD_NOT_ALLOWED(100001, "请求方法有误", null),
    SYS_PARAMETER_NOT_VALID(100002, "参数格式有误", null),
    NOT_PARAM(801, "请检查参数是否传入",null),
    UPLOAD_FAIL(2001, "上传失败",null),

    SYS_PARAMETER_REQUIRED(100002, "缺少参数", null),
    SYS_FORBIDDEN(100003, "非法操作", null),
    SYS_NEED_RETRY(100004, "操作失败，请重试", null),

    COMMOM_CONTAIN_ILLEGAL_CHARACTER(200000, "输入包含非法字符", null),
    COMMOM_EMAIL_MALFORMATED(2000001, "邮箱格式有误", null),
    COMMOM_URL_MALFORMATED(2000002, "网址格式有误", null),

    AUTH_UNAUTHORIZED(201000, "需要登录", null),
    AUTH_BAD_CREDENTIALS(201001, "账户名或密码错误", null),
    AUTH_FORBIDDEN(2010005, "权限不足", null),

    ;

    private final int code;

    private final String msg;

    private final String tipStr;

    ResultStatus(int code, String msg, String tipStr) {
        this.code = code;
        this.msg = msg;
        this.tipStr = tipStr == null ? msg : tipStr;
    }
}
